//
//  BVPersonalBasketballInfoTableViewCell.m
//  BVHomeScene
//
//  Created by xiute on 2019/10/17.
//

#import "BVPersonalBasketballInfoTableViewCell.h"
#import "UILabel+BV.h"


@interface BVPersonalBasketballInfoTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *videoCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *inBallCountLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLengthLabel;


@end

@implementation BVPersonalBasketballInfoTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.videoCountLabel setCustomFont];
    [self.inBallCountLabel setCustomFont];
    [self.timeLengthLabel setCustomFont];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    // Initialization code
}

- (void)configWithModel:(BVUserInfoModel *)model {
    double duration = model.count.duration.doubleValue;
    self.inBallCountLabel.text = [NSString stringWithFormat:@"%@", model.count.gmeta_num];
    self.videoCountLabel.text = [NSString stringWithFormat:@"%@", model.count.vmeta_num];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:duration];
    NSDateFormatter *dateF = [[NSDateFormatter alloc] init];
    [dateF setDateFormat:@"HH:mm:ss"];
    self.timeLengthLabel.text = [dateF stringFromDate:date];
}

- (void)configWithWorkoutModel:(BVWorkOutDetailModel *)model {
    self.inBallCountLabel.text = [NSString stringWithFormat:@"%@", model.gmetaNum];
    self.videoCountLabel.text = [NSString stringWithFormat:@"%@", model.vmetaNum];
    double second = [model.leaveAt.date secondsLaterThan:model.enterAt.date];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:second];
    self.timeLengthLabel.text = [date formattedDateWithFormat:@"HH:mm:ss"];
}

+ (CGFloat)cellHeight {
    return 105;
}
@end
